<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head></head>
<body><h2 class="Welcome">Using Extended Attributes ghost directory</h2>FSAL layer provides, via the <span style="font-style: italic;">FSAL_XAttr* </span>functions, a way to manipulated extended attributes. These are namespace specific attributes, dependant of each FSAL. <br>In
the NFSv4 protocol, there is something called "named attributes": for a
given NFS accessed object and a given file handle, the NFS4_OP_OPENATTR
provides you with a special filehandle (named attribute file handle)to
a directory. This directory contains one file per extended attributes
related to the file. This directory won't be visible to the end user,
only by the client in the kernel. The end use will use regular xattr
command line interface.<br><br>NFS-GANESHA
will support named attributes,
but since they are NFSv4 specific feature, it has a way to access then
in NFSv3 as well. The choice that was made is to introduce a "xattr
ghost directory" with "ghost files" that let the extended attributes be
browsed in a pocfs-like way.<br><br>An example will show you this feature much better.<br><br>I have compiled a NFS-GANESHA with FSAL_POSIX. <br><br>A <span style="font-style: italic;">ls </span>command shows me this (this is a NFSv3 mount point)<br><div style="margin-left: 40px;">[root@itchy mnt]# ls -l<br>total 20<br>-rw-r--r-- 1 root root&nbsp;&nbsp;&nbsp; 0 Sep 19 12:26 file<br>drwxr-xr-x 5 root root 4096 Aug&nbsp; 8 16:02 phil<br>drwx------ 4 usr1 grp1 4096 Jul 25 10:40 usr1<br>drwx------ 4 usr2 grp1 4096 Jul 25 10:40 usr2<br>drwx------ 4 usr3 grp1 4096 Jul 29 13:25 usr3<br></div><br><br>For a object named <span style="font-style: italic;">foo</span> in the namespace there is a "ghost directory" name .<span style="font-style: italic;">xattr.d.foo</span> which contain its named attributes. In my example, for the directory name "phil", I will use ghost directory ".xattr.d.phil"<br><br>Let's try to "ls" on this ghost directory<br><div style="margin-left: 40px;">[root@itchy mnt]# ls -la .xattr.d.phil<br>total 4<br>drwxr-x--- 2 root root 512 Aug&nbsp; 8 16:02 .<br>drwxr-x--- 2 root root 512 Aug&nbsp; 8 16:02 .<br>-rw-r----- 2 root root 512 Aug&nbsp; 8 16:02 device_id<br>-rw-r----- 2 root root 512 Aug&nbsp; 8 16:02 fsal_object_id<br>-rw-r----- 2 root root 512 Aug&nbsp; 8 16:02 inode<br>-rw-r----- 2 root root 512 Aug&nbsp; 8 16:02 path<br>-rw-r----- 2 root root 512 Aug&nbsp; 8 16:02 timestamp<br>-rw-r----- 2 root root 512 Aug&nbsp; 8 16:02 type<br></div><br><br>I can see different files, each of them linked to a specific FSAL Xattr. I can read the content of these ghost files<br><div style="margin-left: 40px;">[root@itchy mnt]# cat .xattr.d.phil/fsal_object_id<br>37051<br></div><br>Note: these are no actual FS object, you won't find them when using the "find" utility. <br><br>These feature may be disable, you will then need to add <span style="font-style: italic;">&nbsp;--disable-xattr-directory </span>to your "./configure"<br><br><br><br></body></html>